﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace newAccount
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private static List<Canvas> CanvasList;
        public static userinfo state;
        int i;
        public MainWindow()
        {
            InitializeComponent();

            i = 0;
            CanvasList = new List<Canvas>();
            state = new userinfo();
            CanvasList.Add(cvsMainWindow);
            CanvasList.Add(cvsUserAgreement);
            CanvasList.Add(cvsAccountName);
            CanvasList[0].Visibility = Visibility.Visible;
        }

        private void btnNext_Click(object sender, RoutedEventArgs e)
        {

            if (i < 2)
            {
                CanvasList[i].Visibility = Visibility.Hidden;
                i = i + 1;
                CanvasList[i].Visibility = Visibility.Visible;
            }
            if (i == 2)
            {
                btnOk.Visibility = Visibility.Visible;
                btnNext.Visibility = Visibility.Hidden;
            }

        }

        private void btnBack_Click(object sender, RoutedEventArgs e)
        {
            if (i > 0)
            {
                CanvasList[i].Visibility = Visibility.Hidden;
                i = i - 1;
                CanvasList[i].Visibility = Visibility.Visible;
                btnOk.Visibility = Visibility.Hidden;
                btnNext.Visibility = Visibility.Visible;
            }
        }

        private void tbxCancel_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            state.email = tbxEmail.Text;
            state.username = tbxName.Text;
            state.password = tbxPass.Text;
            state.phone = tbxPhone.Text;
            
        }
    }
}
